package com.bianguo.android.functiondemo.retrofit;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

public abstract class BaseSubscribe<T> implements Observer<T> {

    private Disposable disposable;

    @Override
    public void onSubscribe(Disposable d) {
        disposable = d;
    }

    @Override
    public void onComplete() {
        if (disposable.isDisposed()) {
            disposable.dispose();
        }
    }
}
